//
//  UTDevice.swift
//  iPhoneUTests
//
//  Created by Toj on 3/28/23.
//

import XCTest

class UTDevice: XCTestCase {

    override func setUpWithError() throws {
        // Put setup code here. This method is called before the invocation of each test method in the class.
    }

    override func tearDownWithError() throws {
        // Put teardown code here. This method is called after the invocation of each test method in the class.
    }

    func testExample() throws {
        print("-->UTests: start \n")
        testDeviceInfo()
        print("-->UTests: end \n")
    }

    func testPerformanceExample() throws {
        // This is an example of a performance test case.
        self.measure {
            // Put the code you want to measure the time of here.
        }
    }
}

extension UTDevice {
    
    private func testDeviceInfo() {
        
        print("-->UTests: name: \(UIDevice.current.name)")
        print("-->UTests: model: \(UIDevice.current.model)")
        print("-->UTests: localizedModel: \(UIDevice.current.localizedModel)")
        print("-->UTests: systemName: \(UIDevice.current.systemName)")
        print("-->UTests: systemVersion: \(UIDevice.current.systemVersion)")
        print("-->UTests: batteryState: \(UIDevice.current.batteryState.rawValue)")
        print("-->UTests: batteryLevel: \(UIDevice.current.batteryLevel)")
        
        print("-->UTests: system \n")
        
        print("-->UTests: machine: \(UIDevice.current.dv_machine)")
        print("-->UTests: iPhoneName: \(UIDevice.current.dv_iOSName)")
        print("-->UTests: sysname: \(UIDevice.current.dv_sysname)")
        print("-->UTests: version: \(UIDevice.current.dv_version)")
        print("-->UTests: nodename: \(UIDevice.current.dv_nodename)")
        print("-->UTests: release: \(UIDevice.current.dv_release)")
        print("-->UTests: machine2: \(UIDevice.current.dv_machine2)")
        print("-->UTests: identifier: \(UIDevice.current.dv_identifier)")
        
        print("-->UTests: dv \n")
        
        print("-->UTests: carrierName: \(UIDevice.current.tp_carrierName)")
        print("-->UTests: countryCode: \(UIDevice.current.tp_countryCode)")
        print("-->UTests: networkCode: \(UIDevice.current.tp_networkCode)")
        print("-->UTests: isoCountryCode: \(UIDevice.current.tp_isoCountryCode)")
        print("-->UTests: isAllowsVOIP: \(UIDevice.current.tp_isAllowsVOIP)")
        
        print("-->UTests: tp \n")
    }
}
